#coding=utf-8

from django.conf.urls.defaults import *
from django.conf import settings

def _get_django_admin_media_root():
    import django
    import os
    return os.path.join(os.path.dirname(django.__file__), 'contrib', 'admin', 'media')

urlpatterns = patterns('',
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^$', '{{ project_name }}.views.index'),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^media/admin/(?P<path>.*)$', 'django.views.static.serve', {'document_root': _get_django_admin_media_root()}),
        (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
   )
